/**
 * 上海中赢金融信息服务有限公司
 * Copyright (c) 2016-2026 hmc,Inc.All Rights Reserved.
 */
package com.sys.midware.hadoop.config;

import com.sys.midware.config.core.ConfigContainer;
import com.sys.midware.config.core.ConfigKey;
import com.sys.midware.logger.Logger;
import com.sys.midware.logger.LoggerFactory;

/**
 * hadoop配置工具类
 * <b>@author：</b> mobing <br/>
 * <b>@date：</b> 2015年10月19日 下午2:55:02 <br/>
 * <b>@version: </b> <br/>
 */
public class HadoopConfigUtil {
    private static final Logger logger = LoggerFactory.getLogger(HadoopConfigUtil.class);

    /**
     * ConfigContainer instance
     */
    private static ConfigContainer cfg = ConfigContainer.getInstance(ConfigKey.ConfigFile.CONFIG_FILE_ROOT);

   private static boolean inited =false;
    public static void initConfig() {
        if(inited){
            return;
        }
        logger.info("begin to init hadoop config ...");
        HadoopConfig config = new HadoopConfig();
        config.setHdfsURI(cfg.getParamString(HadoopConfigKey.KEY_HDFS_URI));
        HadoopConfigHolder.put(config);
        inited = true;
        logger.info("finish to init hadoop config" + config);
    }

}
